package com.jingdianjichi.subject.common.enums;

import lombok.Getter;

/**
 * 删除状态枚举
 *
 * @Author: khj
 * @Date: 2025/3/31
 */
@Getter
public enum IsDeletedFlagEnum {

    DELETE(1, "已删除"),
    UN_DELETED(0, "未删除");

    private int code;

    private String desc;

    IsDeletedFlagEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static IsDeletedFlagEnum getByCode(int codeVal) {
        for(IsDeletedFlagEnum resultCodeEnum : IsDeletedFlagEnum.values()) {
            if(resultCodeEnum.getCode() == codeVal) {
                return resultCodeEnum;
            }
        }
        return null;
    }
}
